<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
  xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
	xmlns:dentalConverters="clr-namespace:DentalConfig.Converters;assembly=DentalConfig">
  <!-- Resource dictionary entries should be defined here. -->

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="../Brushes/Common.xaml"/>
    <ResourceDictionary Source="../../Common/Brushes/Common.xaml"/>
    <ResourceDictionary Source="../MaterialControlStyles/MaterialDesignTheme.ListView.xaml"/>
  </ResourceDictionary.MergedDictionaries>

	<dentalConverters:BrushToTransmittantBrushConverter x:Key="BrushToTransmittantBrushConverter"/>

  <Style x:Key="TreatmentListViewColumnHeader" BasedOn="{StaticResource MaterialDesignGridViewColumnHeader}" TargetType="GridViewColumnHeader">
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="FontSize" Value="{DynamicResource MidSubHeaderFontSize}" />
    <Setter Property="FontFamily" Value="{DynamicResource BoldFontFamily}"/>
    <Setter Property="MinHeight" Value="36"/>
    <Setter Property="Height" Value="Auto"/>
    <Setter Property="Margin" Value="0,12"/>
		<Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListView}}, Converter={StaticResource BrushToTransmittantBrushConverter}, ConverterParameter=0.72, FallbackValue={StaticResource MaterialDesignColumnHeader}}" />
		<Setter Property="Background" Value="{DynamicResource MaterialDesignTreatmentListMainCardBackground}" />
		<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTreatmentListMainCardBackground}" />
		<Setter Property="BorderThickness" Value="1,0" />
		<Style.Triggers>
			<Trigger Property="IsMouseOver" Value="True">
				<Setter Property="BorderBrush" Value="{Binding Foreground, RelativeSource={RelativeSource Self}, Converter={StaticResource BrushToTransmittantBrushConverter}, ConverterParameter=0.12}" />
			</Trigger>
		</Style.Triggers>
  </Style>

  <!-- used in treatmentlistview, does not have dotted separator -->
  <Style x:Key="TreatmentListViewLikeItemStyle" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="Height" Value="Auto"/>
    <Setter Property="MinHeight" Value="24"/> <!-- 24 is minimal height for touch -->
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="Opacity" Value="0.9" />
  </Style>

	<Style x:Key="TreatmentListViewItemStyle" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource TreatmentListViewLikeItemStyle}">
		<Style.Triggers>
			<DataTrigger Binding="{Binding Path=IsUnread}" Value="True" >
				<Setter Property="FontFamily" Value="{DynamicResource BoldFontFamily}" />
				<Setter Property="Foreground" Value="{DynamicResource UnreadBrush}" />
				<Setter Property="Opacity" Value="1" />
			</DataTrigger>
			<DataTrigger Binding="{Binding Path=Moonlighting}" Value="1" >
				<Setter Property="Foreground" Value="{DynamicResource ValidationErrorBrush}" />
			</DataTrigger>
			<DataTrigger Binding="{Binding Path=IsLoaded}" Value="True">
				<Setter Property="Background">
					<Setter.Value>
						<SolidColorBrush Color="{Binding Color, Source={StaticResource CurrentProjectHighlightBrush}}" Opacity="0.4" po:Freeze="True"/>
					</Setter.Value>
				</Setter>
			</DataTrigger>
		</Style.Triggers>
	</Style>

</ResourceDictionary>
